/*      $Id: HTTPResponse.java 799 2008-08-23 18:56:37Z phrakt $    */
/*
 * Copyright (c) 2007 Jean-Francois Brousseau <phrakt@gmail.com>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
package ca.terraquati.canopy.http;


/**
 *
 *
 * @author Jean-Fran&ccedil;ois Brousseau
 */
public interface HTTPResponse extends HTTPMessage
{

	public enum Status {
		CONTINUE		(100, "Continue"),
		OK			(200, "OK"),
		CREATED			(201, "Created"),
		ACCEPTED		(202, "Accepted"),
		NO_CONTENT		(204, "No Content"),
		RESET_CONTENT		(205, "Reset Content"),
		PARTIAL_CONTENT		(206, "Partial Content"),
		MULTIPLE_CHOICES	(300, "Multiple Choices"),
		MOVED			(301, "Moved"),
		FOUND			(302, "Found"),
		SEE_OTHER		(303, "See Other"),
		NOT_MODIFIED		(304, "Not Modified"),
		USE_PROXY		(305, "Use Proxy"),
		TEMP_REDIRECT		(306, "Temporary Redirect"),
		BAD_REQUEST		(400, "Bad Request"),
		UNAUTH			(401, "Unauthorized"),
		FORBIDDEN		(403, "Forbidden"),
		NOT_FOUND		(404, "Not Found"),
		METHOD_NOT_ALLOWED	(405, "Method Not Allowed"),
		NOT_ACCEPTABLE		(406, "Not Acceptable"),
		TIMEOUT			(408, "Request Timeout"),
		CONFLICT		(409, "Conflict"),
		GONE			(410, "Gone"),
		LENGTH_REQUIRED		(411, "Length Required"),
		PRECONDITION_FAILED	(412, "Precondition Failed"),
		REQUEST_TOO_LARGE	(413, "Request Entity Too Large"),
		URI_TOO_LONG		(414, "Request-URI Too Long"),
		BAD_MEDIA_TYPE		(415, "Unsupported Media Type"),
		EXPECTATION_FAILED	(417, "Expectation Failed"),
		SERVER_ERROR		(500, "Internal Server Error"),
		NOT_IMPLEMENTED		(501, "Not Implemented"),
		UNAVAILABLE		(503, "Unavailable"),
		BAD_HTTP_VERSION	(505, "HTTP Version Not Supported");

		private final int	statusCode;
		private final String	statusMsg;

		Status(int code, String msg)
		{
			this.statusCode = code;
			this.statusMsg = msg;
		}

		public int getCode()
		{
			return this.statusCode;
		}

		public String getMsg()
		{
			return this.statusMsg;
		}
	};

	/**
	 *
	 */
	public Status getStatusCode();

	/**
	 *
	 */
	public void setStatusCode(final Status code);
}
